package com.lanou.moving.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

import com.lanou.moving.R;
import com.lanou.moving.adapter.SearchSingerContentAdapter;
import com.lanou.moving.base.BaseActivity;
import com.lanou.moving.base.BaseApplication;

/**
 * Created by dllo on 15/10/28.
 */
public class SingerContentActivity extends BaseActivity {
    private TabLayout mtabLayout;
    private ViewPager viewPager;
    private SearchSingerContentAdapter adapter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.singer_list);
        BaseApplication.getInstance().addActivity(this);
        mtabLayout= (TabLayout) findViewById(R.id.singercontent_tablayout);
        viewPager= (ViewPager) findViewById(R.id.singercontentviewPager);
        initata();
    }

    private void initata() {
        adapter=new SearchSingerContentAdapter(getSupportFragmentManager());
        viewPager.setAdapter(adapter);
        mtabLayout.setupWithViewPager(viewPager);
        mtabLayout.setTabsFromPagerAdapter(adapter);

    }
}
